<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:c="http://www.w3.org/1999/XSL/Transform">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
    <div th:replace="common/IncludeTop">
    </div>

    <div id="Content">

        <div id="BackLink">
            <a th:href="@{'/adminCatalog/viewEditCategory?categoryId='+${product.categoryId}}">Return to <label th:text="${product.categoryId}"> Category ID </label></a>
        </div>

        <div id="Catalog">

            <h2 th:text="${product.name}">Product's Name</h2>

            <table>
                <tr>
                    <th>Item ID</th>
                    <th>Product ID</th>
                    <th>Description</th>
                    <th>List Price</th>
                    <th>Operate</th>
                </tr>

                <tr th:each="item:${itemList}">
                    <td>
                        <a th:href="@{'/adminCatalog/viewEditItem?itemId='+${item.itemId}+'&productId='+${product.productId}}" th:text="${item.itemId}">itemId</a>
                    </td>
                    <td th:text="${item.productId}">
                        Product ID
                    </td>
                    <td th:text="${item.attribute1 != null? item.attribute1:''}+${item.attribute2 != null? item.attribute2:''}+
                        ${item.attribute3 != null? item.attribute3:''}+${item.attribute4 != null? item.attribute4:''}+${item.attribute5 != null? item.attribute5:''}">
                        Description
                    </td>

                    <td th:text="'$' + ${item.listPrice}">
                        List Price
                    </td>

                    <td>
                        <script type="text/javascript" language="javascript">
                            function confirmAct()
                            {
                                if(confirm('确定要执行此操作吗?'))
                                {
                                    return true;
                                }
                                return false;
                            }
                        </script>
                        <a th:href="@{'/adminCatalog/admindelete?itemId='+${item.itemId}}" onclick="return confirmAct();">Delete</a>
                    </td>
                </tr>
            </table>

            <a th:href="@{'/adminCatalog/viewAddItem?productId='+${product.productId}}"  th:class="Button" th:id="handleOrderButton">
                Add
            </a> &nbsp;
        </div>
    </div>

    <div th:replace="common/IncludeBottom">
    </div>
</body>
</html>